<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/adServing',
    'namespace' => 'Frieza\\Modules\\AdServing\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {

    //APP投放素材
    $router->get('/assets', 'AdAssetsController@getList');
    $router->get('/assets/create', 'AdAssetsController@edit');
    $router->get('/assets/{id}/edit', 'AdAssetsController@edit');
    $router->post('/assets/save', 'AdAssetsController@save');
    $router->delete('/assets/{id}', 'AdAssetsController@del');

    //APP投放代理商
    $router->get('/company', 'AdCompanyController@getList');
    $router->get('/company/create', 'AdCompanyController@edit');
    $router->get('/company/{id}/edit', 'AdCompanyController@edit');
    $router->post('/company/save', 'AdCompanyController@save');
    $router->delete('/company/{id}', 'AdCompanyController@del');

    //APP投放代理人
    $router->get('/person', 'AdPersonController@getList');
    $router->get('/person/create', 'AdPersonController@edit');
    $router->get('/person/{id}/edit', 'AdPersonController@edit');
    $router->post('/person/save', 'AdPersonController@save');
    $router->delete('/person/{id}', 'AdPersonController@del');

    //APP投放渠道分类
    $router->get('/channel/options', 'AdChannelController@getChannelSelectData');
    $router->get('/channel/tab/{level}', 'AdChannelController@getList');
    $router->get('/channel/tab/{level}/create', 'AdChannelController@editWithLvl');
    $router->get('/channel/tab/{level}/{id}/edit', 'AdChannelController@editWithLvl');
    $router->post('/channel/save', 'AdChannelController@save');
    $router->delete('/channel/tab/{level}/{id}', 'AdChannelController@delWithLvl');

    //APP投放
    $router->get('/serving/{id}/status/{status}', 'AdServingController@updateServingStatus');
    $router->get('/serving/options', 'AdServingController@getChannelSelectData');
    $router->get('/serving', 'AdServingController@getList');
    $router->get('/serving/create', 'AdServingController@edit');
    $router->get('/serving/{id}/edit', 'AdServingController@edit');
    $router->post('/serving/save', 'AdServingController@save');
    $router->delete('/serving/{idStr}', 'AdServingController@del');
    $router->post('/serving/release', 'AdServingController@release');
    $router->post('/serving/createIosDefaultUrl', 'AdServingController@createIosUrl');

    //APP投放数据消耗
    $router->get('/serving-data', 'AdServingDataController@getList');
    $router->get('/serving-data/create', 'AdServingDataController@edit');
    $router->get('/serving-data/{id}/edit', 'AdServingDataController@edit');
    $router->post('/serving-data/save', 'AdServingDataController@save');
    $router->get('/serving-data/file-export', 'AdServingDataController@exportData');
    $router->delete('/serving-data/{idStr}', 'AdServingDataController@del');

    //excel
    $router->get('/serving-data/down-excel', 'AdServingDataController@downExcel');
    $router->get('/serving-data/file-import', 'AdServingDataController@importExcel');
    $router->post('/serving-data/save-excel', 'AdServingDataController@saveExcel');

    $router->resource("upload","UploadController");
    $router->post("upload/save","UploadController@save");
    $router->post("upload/noticeAll","UploadController@noticeDrone");
    $router->post("upload/noticeOne","UploadController@putOneChannel");
    $router->resource("uploadLog","UploadLogController");
    // 归因链接
    $router->get('/attribution', 'AttributionLinkController@index');
    $router->get('/attribution/create', 'AttributionLinkController@edit');
    $router->post('/attribution/save', 'AttributionLinkController@save');
    $router->post('/attribution/getChannelCode', 'AttributionLinkController@getChannelCode');
    $router->get('/attribution/options', 'AttributionLinkController@getChannelSelectData');
    $router->get('/attribution/getChannelName', 'AttributionLinkController@getChannelName');
    $router->delete('/attribution/{id}', 'AttributionLinkController@del');
});
